<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Waiting to jump...</title>
    <script type="text/javascript" th:src="@{~/js/jquery-3.1.1.js}"></script>
    <script type="text/javascript" th:src="@{~/js/jquery.cookie.js}"></script>
</head>
<body>
<script type="text/javascript">
    $(function () {
        $.ajax({
            success: function (data, status, xhr) {
                var token = xhr.getResponseHeader('token');
                if (token != null) {
                    $.cookie('token', token, {
                        expires: 7,
                        path: '/'
                    });
                    console.log($.cookie('token'));
                    window.location.href = '/home';
                }
            }
        });
    });
</script>
</body>
</html>